<?php include "inc/head.php"; ?>

<!-- nav -->
<?php include "inc/nav.html"; ?>
<!-- nav -->

<div ng-app="usersApp" ng-controller="usersController" class="container">
	<div class="row" style="margin-bottom: 10px;">
	  <div class="col-lg-6">
	    <ul class="nav nav-pills">
		  <li><a ng-click="onNewBtnClick()" href="javascript:;">测试新增用户</a></li>
		</ul>
	  </div>
	  <div class="col-lg-3 col-lg-offset-3">
	    <div class="input-group">
	      <input ng-model="searchTxt" type="text" class="form-control">
	      <span class="input-group-btn">
	        <button ng-click="onSearchBtnClick();" class="btn btn-default" type="button">Go!</button>
	      </span>
	    </div>
	  </div>
	</div>

<div id="myDlg" class="modal fade">
	  <div class="modal-dialog">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
	        <h4 class="modal-title">新增</h4>
	      </div>
	      <div class="modal-body">
	        <form class="form-horizontal" name="userForm" novalidate>
			  <div class="form-group">
			    <label class="col-sm-2 control-label">用户名</label>
			    <div class="col-sm-6">
			      <input ng-minlength="5" ng-maxlength="10" required name="username" ng-model="username" type="text" class="form-control" placeholder="">
			      <!-- <span style="color:red" ng-show="userForm.username.$dirty && userForm.username.$invalid">
					<span ng-show="userForm.username.$error.required">用户名是必须的。</span>
					</span> -->
			    </div>
			  </div>
			  <div class="form-group">
			    <label class="col-sm-2 control-label">姓名</label>
			    <div class="col-sm-6">
			      <input ng-pattern="/[\u4E00-\u9FA5\uF900-\uFA2D]/" required name="realname" ng-model="realname" type="text" class="form-control" placeholder="">
			    </div>
			  </div>
			  <div class="form-group has-feedback" ng-class="{'has-warning':userForm.password.$dirty && userForm.password.$error.required, 'has-error':userForm.password.$dirty && userForm.password.$error.minlength, 'has-success':userForm.password.$valid}">
			    <label class="col-sm-2 control-label">密码</label>
			    <div class="col-sm-6">
			      <input name="password" minlength="6" ng-model="password" type="password" required class="form-control">
			      <span ng-show="userForm.password.$valid" class="glyphicon glyphicon-ok form-control-feedback"></span>
			      <span ng-show="userForm.password.$dirty && userForm.password.$error.required" class="glyphicon glyphicon-warning-sign form-control-feedback"></span>
			      <span ng-show="userForm.password.$dirty && userForm.password.$error.minlength" class="glyphicon glyphicon-remove form-control-feedback"></span>
			    </div>
			  </div>
			  <div class="form-group">
			    <label class="col-sm-2 control-label">邮箱</label>
			    <div class="col-sm-6">
			      <input name="email" ng-model="email" type="email" class="form-control" placeholder="">
					<!-- <span style="color:red" ng-show="userForm.email.$dirty && userForm.email.$invalid">
						<span ng-show="userForm.email.$error.required">邮箱是必须的。</span>
						<span ng-show="userForm.email.$error.email">非法的邮箱地址。</span>
					</span> -->
			    </div>
			  </div>
			  <div class="form-group">
			    <label class="col-sm-2 control-label">手机</label>
			    <div class="col-sm-6">
			      <input ng-pattern="/^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/" name="mobile" ng-model="mobile" type="mobile" class="form-control" placeholder="">
			    </div>
			  </div>
			</form>
	      </div>
	      <div class="modal-footer">
	        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
	        <button type="button" class="btn btn-primary" ng-click="saveUser();">保存</button>
	        <!-- <button ng-disabled="userForm.username.$invalid ||  
userForm.email.$invalid || userForm.mobile.$invalid" ng-click="saveClassify()" type="button" class="btn btn-primary">保存</button> -->
	      </div>
	    </div><!-- /.modal-content -->
	  </div><!-- /.modal-dialog -->
	</div><!-- /.modal -->
</div>

<script src="../../bower_components/angular/angular.min.js"></script>
<script src="../../bower_components/underscore/underscore-min.js"></script>
<script src="js/users.js"></script>

<?php include "inc/foot.php"; ?>